﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SamplingReport.aspx.cs"
    Inherits="PPAP.Web.SearchReport.SamplingReport" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagPrefix="cc1" Namespace="PPAP.WebControls" Assembly="PPAP.WebControls" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../Common/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
        <table width="800px" style="border-color: #2A48CE; border: 1px; border-style: solid;
            border-color: Gray; border-spacing: 0px;">
            <tr style="height: 32px;">
                <td style="font-weight: bold;" bgcolor="#D7D7D7" colspan="4">
                    Filter SET
                </td>
            </tr>
            <tr>
                <td>
                    Sampling report No.:
                </td>
                <td>
                    <asp:TextBox ID="txtSamplingReportNo" runat="server" Width="200px"></asp:TextBox>
                </td>
                <td>
                    Supplier Code:
                </td>
                <td>
                    <asp:TextBox ID="txtSupplierNo" runat="server" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Report created:
                </td>
                <td>
                    <cc1:My97 ID="txtCreateStart" runat="server" Width="100px"></cc1:My97>
                    To:<cc1:My97 ID="txtCreateEnd" runat="server" Width="100px"></cc1:My97>
                </td>
                <td>
                    Part No:
                </td>
                <td>
                    <cc1:PartNo ID="txtPartNo" runat="server" Width="200px" />
                </td>
            </tr>
            <tr>
                <td>
                    Revision:
                </td>
                <td>
                    <asp:TextBox ID="txtVersion" runat="server" Width="200px"></asp:TextBox>
                </td>
                <td>
                    Sampling reason:
                </td>
                <td>
                    <asp:DropDownList ID="ddlReason" runat="server" Width="200px">
                        <asp:ListItem>All</asp:ListItem>
                        <asp:ListItem Value="Initial sampling">Initial sampling</asp:ListItem>
                        <asp:ListItem Value="Other samples">Other samples</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server" Width="200px" Visible="False">
                        <asp:ListItem>All</asp:ListItem>
                        <asp:ListItem Value="0">N/A</asp:ListItem>
                        <asp:ListItem Value="1">Created</asp:ListItem>
                        <asp:ListItem Value="2">Submitted</asp:ListItem>
                        <asp:ListItem Value="3">Not ready for sampling</asp:ListItem>
                        <asp:ListItem Value="4">Ready for sampling</asp:ListItem>
                        <asp:ListItem Value="5">Circulating</asp:ListItem>
                        <asp:ListItem Value="6">Released</asp:ListItem>
                        <asp:ListItem Value="7">Decided</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td align="left" colspan="2">
                    &nbsp;
                </td>
                <td align="center">
                    &nbsp;
                </td>
                <td align="right" style="padding-right: 30px;">
                    <asp:Button ID="btnSubmit" CssClass="button" runat="server" Text="Search" OnClick="btnSubmit_Click" />
                    &nbsp;
                    <asp:Button ID="btnExport" CssClass="button" runat="server" Text="Export" OnClick="btnExport_Click" />
                </td>
            </tr>
        </table>
        <br />
        <asp:DataGrid ID="dgList" HeaderStyle-BackColor="#2E8AC5" HeaderStyle-Font-Bold="true"
            HeaderStyle-Height="32px" Width="100%" AllowSorting="true" OnLoad="dgLoad" AutoGenerateColumns="False"
            runat="server" onsortcommand="dgList_SortCommand">
            <Columns>
                <asp:BoundColumn DataField="rownum" HeaderText="No." FooterText="No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="samplingreportno" SortExpression="samplingreportno" HeaderText="Sampling report No." FooterText="Sampling report No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="pparno" SortExpression="pparno" HeaderText="PPAR No." FooterText="PPAR No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="bdntpartno" SortExpression="bdntpartno" HeaderText="Part No." FooterText="Part No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="suppliercode" SortExpression="suppliercode" HeaderText="Suppiler Code" FooterText="Suppiler Code">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="PPARVERSION" HeaderText="PPAR version" Visible="false">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Status" FooterText="Status">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%#ShowAuditStatus(Eval("STATUS").ToString(),Eval("FINALSTATUS").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Created date" FooterText="Created date" SortExpression="ppardate">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%#Eval("ppardate").ToString()==""?"":DateTime.Parse(Eval("ppardate").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Print" FooterText="Print" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <img src="../Images/newimg/printer.png" title="Print" onclick="<%#"javascript:print("+Eval("ID")+")" %>" />
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Height="32px"></HeaderStyle>
        </asp:DataGrid>
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" Width="100%" CssClass="paginator"
            ShowPageIndexBox="Always" PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto"
            HorizontalAlign="Center" PageSize="20" EnableTheming="true" AlwaysShow="True"
            FirstPageText="|&lt;" LastPageText="&gt;|" NextPageText="&gt;" PrevPageText="&lt;"
            SubmitButtonText="Go" TextAfterPageIndexBox="page" InvalidPageIndexErrorMessage="Page index is not effective numerical！"
            OnPageChanged="AspNetPager2_PageChanged" PageIndexOutOfRangeErrorMessage="Page index beyond range"
            BackColor="#E7E8E8">
        </webdiyer:AspNetPager>
    </div>
    </form>
    <script language="javascript">

        function print(id) {
            url = "../Part/Report.aspx?rid=" + id;
            PopUpWindow(url, 100, 10, 1080, 700);
        }
    </script>
</body>
</html>
